<template>
  <a-modal
    :title="title"
    :width="modalWidth"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @cancel="handleCancel"
  >
    <a-spin :spinning="confirmLoading">
      <div style="margin-left: 10%;">
        <div style="margin:20px">{{$t('前端版本：')}}{{info.version}}</div>
        <div style="margin:20px">{{$t('服务器版本：')}}{{info.apiVersion}}</div>
        <div style="margin:20px">{{$t('数据库版本：')}}{{info.dbVersion}} ({{info.dbName}})</div>
        <div style="margin:20px" v-if="info.browserVer">{{$t('浏览器壳：')}}{{info.browserVer}}</div>
      </div>
    </a-spin>
  <template slot="footer">
    <a-button @click="handleCancel">{{$t('关闭')}}</a-button>
  </template>
  </a-modal>
</template>

<script>
import { getAction } from '@/api/manage'

  export default {
    name: "AboutSystem",
    data () {
      return {
        title:this.$t('系统关于'),
        modalWidth:470,
        visible: false,
        confirmLoading: false,
        info:{
          version:"",
          apiVersion:"",
          dbVersion:"",
          browserVer:""
        },
      }
    },
    methods: {
      show(){
        let that = this
        that.visible = true
        // this.$set(this.info,'version',"V" + window._CONFIG['vueVersion'])
        that.info.version = "V" + window._CONFIG['vueVersion']
        getAction('/bis/bisSysParameter/getVersion').then(res=>{
          if(res.success){
            that.info.apiVersion = res.result.apiVersion
            that.info.dbVersion = res.result.dbVersion
            that.info.dbName = res.result.dbName
          }
        })
        let res = plugin.getVersion();
        that.info.browserVer = res?"V" + res:'';
      },
      handleCancel () {
        this.close()
      },
      close () {
        this.visible = false;
      },

    }
  }
</script>

<style scoped>

</style>

